# Maintainer: Sven-Hendrik Haase <svenstaro@archlinux.org>
# Contributor: Baris Demirdelen <barisdemirdelen at gmail dot com>
# Contributor: Andrew Anderson <aanderso@tcd.ie>
# Contributor: Jonathon Fernyhough <jonathon_at manjaro_dotorg>
pkgname=onednn
pkgver=3.3.1
pkgrel=1
pkgdesc="oneAPI Deep Neural Network Library (oneDNN)"
arch=(loong64 x86_64)
replaces=('intel-dnnl' 'mkl-dnn')
provides=('intel-dnnl' 'mkl-dnn')
url=https://github.com/oneapi-src/oneDNN
license=('APACHE')
depends=('gcc-libs')
makedepends=('cmake' 'ninja')
source=("$pkgname-$pkgver.tar.gz::https://github.com/oneapi-src/oneDNN/archive/v${pkgver}.tar.gz")
sha256sums=('e0b7a9452162e854cf08b4e90bcd1b382b9903ace6a61503a872573880d24c3f')

build() {
  cd "oneDNN-$pkgver"
  cmake \
      -Bbuild \
      -GNinja \
      -DCMAKE_INSTALL_PREFIX="/usr"
  ninja -C build
}

check() {
  cd "oneDNN-$pkgver/build"
  ctest
}

package() {
  cd "oneDNN-$pkgver"
  DESTDIR="$pkgdir" ninja -C build install

  install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
